home *** CD-ROM | disk | FTP | other *** search
- package asp.wizard;
-
- import asp.netobjects.nfx.ui.OrderedListModel;
- import asp.util.ResourceUtil;
- import asp.wizard.util.UiUtil;
- import com.sun.java.swing.BorderFactory;
- import com.sun.java.swing.JButton;
- import com.sun.java.swing.JComboBox;
- import com.sun.java.swing.JLabel;
- import com.sun.java.swing.JList;
- import com.sun.java.swing.JPanel;
- import com.sun.java.swing.JScrollPane;
- import java.awt.Color;
- import java.awt.Component;
- import java.awt.Container;
- import java.awt.Dimension;
- import java.awt.GridBagConstraints;
- import java.awt.GridBagLayout;
-
- public class WVPanelDbQueryJoin extends WVPanelBase {
- private static final String ID_LBL_LHSTABLES = "label.lhstables";
- private static final String ID_LBL_RHSTABLES = "label.rhstables";
- private static final String ID_LBL_LHSFIELDS = "label.lhsfields";
- private static final String ID_LBL_RHSFIELDS = "label.rhsfields";
- private static final String ID_LBL_JOINS = "label.joins";
- private static final String ID_BTN_ADDJOIN = "button.addjoin";
- private static final String ID_BTN_REMOVEJOIN = "button.removejoin";
- private static final int LIST_WIDTH = 110;
- private static final int JOIN_LIST_WIDTH = 60;
- JLabel _lblLhsTables;
- JLabel _lblRhsTables;
- JComboBox _cboLhsTables;
- JComboBox _cboRhsTables;
- JLabel _lblLhsFields;
- JLabel _lblRhsFields;
- JLabel _lblJoins;
- JList _lboLhsFields;
- JScrollPane _scpLhsFields;
- JList _lboRhsFields;
- JScrollPane _scpRhsFields;
- JButton _btnAddJoin;
- JList _lboJoins;
- JPanel _pnlVerticalBar;
- JScrollPane _scpJoins;
- JButton _btnRemoveJoin;
-
- protected void initialize() {
- }
-
- protected void initComponents() {
- super.initComponents();
- ResourceUtil ru = ((WVPanelBase)this).getResourceUtil();
- JPanel contentPanel = ((WVPanelBase)this).getContentPanel();
- Color bgcolor = ((Component)contentPanel).getBackground();
- this._cboLhsTables = new JComboBox();
- this._lblLhsTables = UiUtil.setupLabel(new JLabel(ru.getString("label.lhstables")), this._cboLhsTables);
- this._lblLhsTables.setDisplayedMnemonic(ru.getMnemonic("label.lhstables"));
- this._cboRhsTables = new JComboBox();
- this._lblRhsTables = UiUtil.setupLabel(new JLabel(ru.getString("label.rhstables")), this._cboRhsTables);
- this._lblRhsTables.setDisplayedMnemonic(ru.getMnemonic("label.rhstables"));
- this._lboLhsFields = new JList();
- this._lboLhsFields.setModel(new OrderedListModel());
- this._lboLhsFields.setFixedCellWidth(110);
- this._lboLhsFields.setSelectionMode(0);
- this._scpLhsFields = new JScrollPane(this._lboLhsFields);
- this._lblLhsFields = UiUtil.setupLabel(new JLabel(ru.getString("label.lhsfields")), this._lboLhsFields);
- this._lblLhsFields.setDisplayedMnemonic(ru.getMnemonic("label.lhsfields"));
- this._lboRhsFields = new JList();
- this._lboRhsFields.setModel(new OrderedListModel());
- this._lboRhsFields.setFixedCellWidth(110);
- this._lboRhsFields.setSelectionMode(0);
- this._scpRhsFields = new JScrollPane(this._lboRhsFields);
- this._lblRhsFields = UiUtil.setupLabel(new JLabel(ru.getString("label.rhsfields")), this._lboRhsFields);
- this._lblRhsFields.setDisplayedMnemonic(ru.getMnemonic("label.rhsfields"));
- this._btnAddJoin = new JButton(ru.getString("button.addjoin"));
- this._btnAddJoin.setMnemonic(ru.getMnemonic("button.addjoin"));
- this._pnlVerticalBar = new JPanel();
- this._pnlVerticalBar.setBorder(BorderFactory.createEtchedBorder());
- this._pnlVerticalBar.setMinimumSize(new Dimension(2, 2));
- this._pnlVerticalBar.setPreferredSize(new Dimension(2, 100));
- this._lboJoins = new JList();
- this._lboJoins.setModel(new OrderedListModel());
- this._scpJoins = new JScrollPane(this._lboJoins);
- this._lblJoins = UiUtil.setupLabel(new JLabel(ru.getString("label.joins")), this._lboJoins);
- this._lblJoins.setDisplayedMnemonic(ru.getMnemonic("label.joins"));
- this._btnRemoveJoin = new JButton(ru.getString("button.removejoin"));
- this._btnRemoveJoin.setMnemonic(ru.getMnemonic("button.removejoin"));
- }
-
- protected void initLayout() {
- super.initLayout();
- JPanel contentPanel = ((WVPanelBase)this).getContentPanel();
- GridBagLayout gbl = new GridBagLayout();
- GridBagConstraints gbc = new GridBagConstraints();
- ((Container)contentPanel).setLayout(gbl);
- gbc.ipady = 5;
- UiUtil.addComponent(contentPanel, super._txpIntro, gbl, gbc, 0, 0, 5, 1, (double)0.0F, (double)0.0F, 18, 2, 0, 0, 10, 0);
- gbc.ipady = 0;
- UiUtil.addComponent(contentPanel, this._lblLhsTables, gbl, gbc, 0, 1, 1, 1, (double)0.0F, (double)0.0F, 18, 2, 0, 0, 0, 5);
- UiUtil.addComponent(contentPanel, this._lblRhsTables, gbl, gbc, 1, 1, 1, 1, (double)0.0F, (double)0.0F, 18, 2, 0, 5, 0, 0);
- UiUtil.addComponent(contentPanel, this._pnlVerticalBar, gbl, gbc, 2, 1, 1, 5, (double)0.0F, (double)0.0F, 10, 3, 10, 7, 0, 7);
- gbc.ipadx = -20;
- UiUtil.addComponent(contentPanel, this._cboLhsTables, gbl, gbc, 0, 2, 1, 1, (double)0.0F, (double)0.0F, 18, 2, 0, 0, 0, 5);
- UiUtil.addComponent(contentPanel, this._cboRhsTables, gbl, gbc, 1, 2, 1, 1, (double)0.0F, (double)0.0F, 18, 2, 0, 5, 0, 0);
- gbc.ipadx = 0;
- UiUtil.addComponent(contentPanel, this._lblLhsFields, gbl, gbc, 0, 3, 1, 1, (double)0.0F, (double)0.0F, 18, 2, 5, 0, 0, 5);
- UiUtil.addComponent(contentPanel, this._lblRhsFields, gbl, gbc, 1, 3, 1, 1, (double)0.0F, (double)0.0F, 18, 2, 5, 5, 0, 0);
- UiUtil.addComponent(contentPanel, this._lblJoins, gbl, gbc, 3, 3, 2, 1, (double)0.0F, (double)0.0F, 18, 2, 5, 0, 0, 0);
- UiUtil.addComponent(contentPanel, this._scpLhsFields, gbl, gbc, 0, 4, 1, 2, (double)0.0F, (double)0.0F, 18, 1, 0, 0, 0, 5);
- UiUtil.addComponent(contentPanel, this._scpRhsFields, gbl, gbc, 1, 4, 1, 2, (double)0.0F, (double)1.0F, 18, 1, 0, 5, 0, 0);
- UiUtil.addComponent(contentPanel, this._scpJoins, gbl, gbc, 3, 4, 2, 1, (double)1.0F, (double)1.0F, 18, 1, 0, 0, 0, 0);
- UiUtil.addComponent(contentPanel, this._btnAddJoin, gbl, gbc, 3, 5, 1, 1, (double)1.0F, (double)0.0F, 13, 0, 5, 0, 0, 0);
- UiUtil.addComponent(contentPanel, this._btnRemoveJoin, gbl, gbc, 4, 5, 1, 1, (double)0.0F, (double)0.0F, 13, 0, 5, 0, 0, 0);
- }
- }
-